<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link href="css/common.css" rel="stylesheet" type="text/css" />
<link href="css/style.css" rel="stylesheet" type="text/css" />
  <script src="js/WebCalendar.js"></script>
</head>

<body>
<div class="wrap">
<!-- main begin-->
  <div class="sale">
    <h1 class="lf">在线拍卖系统</h1>
    <div class="logout right"><a href="#" title="注销">注销</a></div>
  </div>
  <div class="forms">
    <form id="form_query" th:action="@{/findAuctionList}" method="post">
      <input type="hidden" id="pageNumber" name="pageNum" value="1">
      <label for="name">名称</label>
      <input name="auctionname" type="text" class="nwinput" id="name" th:value="${condition.auctionname}"/>
      <label for="names">描述</label>
      <input name="auctiondesc" type="text" id="names" class="nwinput" th:value="${condition.auctiondesc}"/>

      <label for="time">开始时间</label>
      <input name="auctionstarttime"
             th:value="${#dates.format(condition.auctionstarttime,'yyyy-MM-dd hh:mm:ss')}"
             type="text" id="time" class="nwinput" readonly="readonly" onclick="selectDate(this,'yyyy-MM-dd hh:mm:ss')"/>

      <label for="end-time">结束时间</label>
      <input name="auctionendtime"
             th:value="${#dates.format(condition.auctionendtime,'yyyy-MM-dd hh:mm:ss')}"
             type="text" id="end-time" class="nwinput" readonly="readonly" onclick="selectDate(this,'yyyy-MM-dd hh:mm:ss')"/>

      <label for="price">起拍价</label>
      <input name="auctionstartprice" type="text" id="price" class="nwinput" th:value="${condition.auctionstartprice}"/>
      <input type="submit"  value="查询" class="spbg buttombg f14  sale-buttom"/><br>
      <span th:if="${session.user.userisadmin==1}">
        <input type="button" value="发布" class="spbg buttombg f14  sale-buttom buttomb" onclick="location='/addAuction'"/>
      </span>
      <span th:if="${session.user.userisadmin==0}">
        <input type="button" value="竞拍结果" class="spbg buttombg f14 sale-buttom buttomb" onclick="location='/toAuctionResult'"/>
      </span>
    </form>
  </div>
  <div class="items">
      <ul class="rows even strong">
        <li>名称</li>
        <li class="list-wd">描述</li>
        <li>开始时间</li>
        <li>结束时间</li>
        <li>起拍价</li>
        <li class="borderno">操作</li>
      </ul>
      <ul class="rows" th:each="auction,state:${auctionList}" th:class="${state.odd?'rows':'rows even'}">
        <li><a href="国书" title="" th:text="${auction.auctionname}"></a></li>
        <li class="list-wd" th:text="${auction.auctiondesc}"></li>
        <li th:text="${#dates.format(auction.auctionstarttime,'yyyy-MM-dd hh:MM:ss')}"></li>
        <li th:text="${#dates.format(auction.auctionendtime,'yyyy-MM-dd hh:MM:ss')}"></li>
        <li th:text="${auction.auctionstartprice}"></li>
        <li class="borderno red">
          <div th:if="${session.user.userisadmin==1}">
            <a href="#" title="修改" onclick="dele();">修改</a>|
            <a href="#" title="删除" onclick="abc();">删除</a>
          </div>
          <div th:if="${session.user.userisadmin==0}">
            <a th:href="@{/gentAution(auctionId=${auction.auctionid})}" title="竞拍" onclick="abc();">竞拍</a>
          </div>


        </li>
      </ul>

      <div class="page">
        <a href="#" title="" th:onclick="'getPage(1)'">首页</a>
        <a href="#" title="" th:onclick="'getPage('+${page.prePage}+')'">上一页</a>
        <a href="#" title="" th:onclick="'getPage('+${page.nextPage}+')'">下一页</a>
        <a href="#" title="" th:onclick="'getPage('+${page.pages}+')'">尾页</a>
      </div>
  </div>
  <script>
   function getPage(pageNo) {
     //通过原生js 修改上面隐藏域的值
    document.getElementById("pageNumber").value=pageNo;
    //通过原生js 提交表单
     document.getElementById("form_query").submit();
   }
  </script>
<!-- main end-->
</div>
</body>
</html>
